// server/routes.js
const express = require('express')
const fileController = require('./controllers/fileController.js')
const directoryController = require('./controllers/directoryController.js')
const groupController = require('./controllers/groupController.js')
// const historyResultsController = require('./controllers/historyResultsController.js')
const accuracyAnalysisController = require('./controllers/accuracyAnalysisController.js')

const router = express.Router()

// 文件相关路由
router.post('/files/:folder/:date', fileController.createFile)
router.get('/files/:folder/:file', fileController.getFile)
router.delete('/files/:folder/:file', fileController.deleteFile)

// 目录相关路由
router.get('/tree', directoryController.getTree)
router.get('/directory/:folder', directoryController.getDirectory)
router.delete('/directory/:folder', directoryController.deleteDirectory)

// 组相关路由
router.delete('/group/:folder/:file/:groupName', groupController.deleteGroup)
router.put('/group/:folder/:file/:groupName', groupController.updateGroup)

// 历史结果相关路由
// router.get('/history-results', historyResultsController.getHistoryResults)

// 准确率分析相关路由
router.get('/accuracy-analysis/top-32', accuracyAnalysisController.getTop32)
// 示例数据分析
router.get('/accuracy-analysis/example', accuracyAnalysisController.getExample)

module.exports = router
